package com.secxiot.common.constant;

public enum ServerStatusEnum {

    SUCCESS(200,"处理成功"),
    NOT_FOUND(404,"资源未找到"),
    PARAM_WRONG(412,"请求参数有误"),
    SYSTEM_EXCEPTION(500,"网络开小差了"),
    MOBILE_REGISTRIED(10000,"手机号已经注册"),
    POSSWORD_FALSE(10001,"手机号是空的"),
    PHONE_HAVE(10002,"手机号已存在"),
    USERNAME_HAVE(10003,"帐号已存在"),
    NAME_HAVE(10004,"姓名已存在"),
    TYPE_NOTFOND(10005,"职业不能为空"),
    VALID_SMS_CODE_ERROR(10006,"短信验证码错误"),
    VALID_IDCARD_ERROR(10007,"身份证和姓名校验不通过"),
    LOGIN_FAIL(10008,"账号或密码错误"),
    MSM_SERVICE_ERROR(10009,"短信服务异常"),
    IDCARD_SERVICE_ERROR(10010,"身份证校验服务异常"),
    TASK_NOT_EXIST(10011,"任务不存在"),
    NEWTASK_ISNULL(10012,"没有最新任务"),
    IDNOTADDPERMISSION(10013,"扫码者没有权限添加"),
    NO_DEPT(10014,"无所属部门"),
    BIND_EllEGAL(10015,"不可绑定"),
    BIND_REL_EXITS(10016,"已绑定过此用户"),
    LIST_EMPTY(10017,"该数据为空"),
    SOS_NOT_COMPLETE(10018,"有急救任务正在进行中!!!"),
    RECEIVER_DATA_EXCEPTION(10019,"接收者数据异常"),
    RECEIEDTYPE(10020,"交接人不能为患者"),
    DEPTIDNULL(10021,"部门id不能为空"),
    TASK_NOT_CONFIRMED(10022,"任务未确认"),
    TASK_STATUS_ILLEGAL(10023,"任务状态更新失败"),
    NO_SOS_RECEIVER(10024,"暂无接诊医生!"),
    NO_SOS_HOSPITAL(10025,"暂无接诊医院!"),
    COMMUNICATION_NOT_EXIST(10026,"主题不存在"),
    UPLOAD_FILE_FAILURE(10027,"文件上传失败"),
    TYPE_NOTHOS(10028,"职业所属医院不能为空"),

    NARCOTIC_DRUGS_TYPE_EMPTY(10029,"角色不能为空"),
    NARCOTIC_WXOPENID(10030,"微信唯一标识不能为空"),
    NARCOTIC_DRUGSRECORD_EMPTY(10031,"申请药品记录不存在"),
    NARCOTIC_DOCTORRECORD_EMPTY(10032,"医生药品记录不存在"),
    NARCOTIC_DOCTORRECORD_REASON_EMPTY(10032,"驳回原因不能为空"),
    NARCOTIC_DOCTORRECORD_AUDITED(10033,"药品记录已被审核"),
    PAGENO_EMPTY(10034,"页数不能为空"),
    PAGESIZE_EMPTY(10035,"条数不能为空"),

    NARCOTIC_CHEMISTRECORD_EMPTY(10036,"药师药品记录不存在"),
    NARCOTIC_CHEMISTRECORD_REASON_EMPTY(10037,"驳回原因不能为空"),
    NARCOTIC_CHEMISTRECORD_AUDITED(10038,"药品记录已被审核"),

    NARCOTIC_TAKEMEDICINE_TAKEED(10039,"药品已被领取"),
    NARCOTIC_TAKEDESTORY_ED(10040,"药品已被销毁"),

    NARCOTIC_USERINFO_EMPTY(10041,"资料信息不存在"),
    NARCOTIC_USERINFO_AUDITED(10042,"资料信息已被审核"),
    NARCOTIC_USERINFO_REASON_EMPTY(10043,"驳回原因不能为空"),

    FILESSTORAGE_TITLE_EMPTY(10044,"标题不能为空"),
    FILESSTORAGE_PUBLISHUSER_EMPTY(10045,"发布人不能为空"),
    ID_KEY_EMPTY(10046,"Id不能为空"),

    NOT_DATA_FOUND(10047,"用户信息不存在"),
    TIME_IS_NOT(10048,"时间不能为空"),

    SCHEDUL_RECORD_EMPTY(10049,"排班记录不能为空"),
    NO_BIND_DEPT(10050,"未认证,请联系管理员认证!"),
    TASK_NOT_COMPLETE(10051,"当前医生正在出诊中,不能接受任务!!!"),
    TASK_NOT_LOCATION(10052,"位置上报错误,未获取到经纬度信息"),

    NARCOTIC_INFO_SUBMIT(10053,"请勿重复提交资料!!!"),
    NARCOTIC_DRUGS_RECORD(10054,"请勿重复提交用药申请!!!"),

    SOS_APP_ID_NULL(10055,"APP_ID为空"),
    APP_NULL(10056,"APP无效,请联系管理!!!"),

    TASK_VISIT(10057,"请勿重复发布出诊!!!"),
    TASK_AMBULANCE_NULL(10058,"任务车辆未找到"),
    TASK_NOT_RECEIVER(10059,"请选择任务接收人!!!"),

    NARCOTIC_INFO_EXPIRE(10060,"您的资料卡已到期,请重新提交资料!!!"),
    NARCOTIC_INFO_NOT_AUDIT(10061,"您的资料卡暂未审核,不能申请用药!!!"),
    NARCOTIC_INFO_REJECT(10062,"您的资料卡被驳回,请重新提交资料!!!"),

    PROMOTE_USER_NULL(10063,"推广人为空!!!"),
    PROMOTE_USER_BING(10064,"用户已绑定推广人,请勿重复绑定!!!"),

    NARCOTIC_TAKEDESTROY_AUDITED(10065,"取药记录不存在"),
    ACCOUNT_NULL(10066,"收款账号不存在"),

    WX_ERROR_1(-1,"系统繁忙，此时请开发者稍候再试"),
    WX_ERROR_2(40001,"AppSecret 错误或者 AppSecret 不属于这个小程序，请开发者确认 AppSecret 的正确性\t"),
    WX_ERROR_3(40002,"请确保 grant_type 字段值为 client_credential"),
    WX_ERROR_4(40003,"不合法的 AppID，请开发者检查 AppID 的正确性，避免异常字符，注意大小写"),
    WX_ERROR_5(40003,"touser字段openid为空或者不正确"),
    WX_ERROR_6(40037,"订阅模板id为空不正确"),
    WX_ERROR_7(43101,"用户拒绝接受消息，如果用户之前曾经订阅过，则表示用户取消了订阅关系"),
    WX_ERROR_8(47003,"模板参数不准确，可能为空或者不满足规则，errmsg会提示具体是哪个字段出错"),
    WX_ERROR_9(41030,"page路径不正确，需要保证在现网版本小程序中存在，与app.json保持一致"),

    ;

    public int status;

    public String message;

    ServerStatusEnum(int status, String message) {
        this.status = status;
        this.message = message;
    }

    public int getStatus() {
        return status;
    }

    public String getMessage() {
        return message;
    }

    public static ServerStatusEnum getByStatus(int status){
        for (ServerStatusEnum exceptionEnum : ServerStatusEnum.values()) {
            if (exceptionEnum.getStatus() == status) {
                return exceptionEnum;
            }
        }
        return ServerStatusEnum.NOT_FOUND;
    }
}
